home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1988 January / 1988-01.d64 / cats 'n' dogs (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  100 lines

  1. 10 rem copyright 1988 compute! publications, inc. - all rights reserved
  2. 20 ifa=1then60
  3. 30 print"[147][144]   copyright 1988 compute! pub., inc."
  4. 40 printtab(10)"all rights reserved"
  5. 50 a=1:load"cats 'n' dogs.ml",8,1
  6. 60 dima(7,7),s1(18),s2(18):poke53281,14:poke53280,6:v=53248:s=54272
  7. 70 p1$="player 1":p2$="player 2":pokev+28,255:pokev+29,0:pokev+23,0
  8. 80 pokev+37,1:pokev+38,10:pokev+27,0:forn=0to7:x=50+29*n
  9. 90 poke835-n,x:poke843-n,x-19:pokev+39+n,0:next
  10. 100 pokev,70:pokev+1,60:pokev+2,250:pokev+3,60:pokev+4,165:pokev+5,220
  11. 110 poke2042,248:pokev+21,7:gosub760
  12. 120 forn=54272to54300:poken,0:next:forn=2to18:reads1(n):next
  13. 130 forn=2to18:reads2(n):next
  14. 140 forn=1to7:pokev+n*2,n*34:next:pokev+37,1:pokev+38,10:sys16385
  15. 150 h=0:ve=0:forn=53000to53098:poken,248:next
  16. 160 forn=0to6:fori=0to6:a(n,i)=0:next:next
  17. 170 m=0:pl=0:a=3:x=136:y=50:poke2040,253:poke53248,x:poke53249,y
  18. 180 pokev+16,0:pokev+21,255:pokes+24,13
  19. 190 ty=1:d1=7:forn=0to6:ifa(0,n)=0ora(0,n)=3thenty=0:d1=d1-1
  20. 200 next:ifty=1then980
  21. 210 ifd1<=3ordc<>1then230
  22. 220 dc=0:poke53000+r1+r2*7,248:a(r2,r1)=0:poke53050+r1+r2*7,248
  23. 230 j=56320+pl*jy:co=1-co:ad=55688+pl*240:forn=0to7:pokead+n,co:next
  24. 240 gety$:ify$="[133]"thenpokev+21,0:gosub760:goto150
  25. 250 forn=2to18:pokes+n,s2(n):next:ifk$="1"andpl=1then610
  26. 260 pokes+8,x+pl*14:jv=peek(j):fr=jvand16:iffr=0then300
  27. 270 jv=15-(jvand15):ifjv=8thenx=x+34:a=a+1:pokes+11,17:ifx>238thenx=34:a=0
  28. 280 ifjv=4thenx=x-34:pokes+11,17:a=a-1:ifx<34thenx=238:a=6
  29. 290 poke53248,x:goto190
  30. 300 b=0:ifa(b,a)=3thengosub720:goto400
  31. 310 ifa(b,a)<>0then190
  32. 320 co=0:ad=55688+pl*240:forn=0to7:pokead+n,co:next
  33. 330 y=y+18:poke53249,y:pokes+11,19
  34. 340 b=b+1:ifa(b,a)<>0anda(b,a)<>3thenb=b-1:goto380
  35. 350 forw=1to14:pokes+8,265-y-pl*25:y=y+2:poke53249,y:next
  36. 360 ifa(b,a)=3thena(b,a)=0:gosub720:goto400
  37. 370 ifb<6then340
  38. 380 poke53000+a+b*7,252+pl*2:a(b,a)=1-pl*2
  39. 390 pokes+11,0:poke53050+a+b*7,252+pl*2
  40. 400 pokev+21,254:m=m+1:ifm<7then420
  41. 410 sys16586:ifpeek(853)=3then480
  42. 420 pl=1-pl:poke2040,253+pl*2:x=136:y=50
  43. 430 a=3:poke53248,x:poke53249,y:pokev+21,255
  44. 440 ifdc<>1then190
  45. 450 poke53000+r1+r2*7,248:a(r2,r1)=0:poke53050+r1+r2*7,248
  46. 460 r1=int(rnd(1)*7):r2=int(rnd(1)*7):ifa(r2,r1)<>0then460
  47. 470 poke53000+r1+r2*7,250:a(r2,r1)=3:poke53050+r1+r2*7,250:goto190
  48. 480 forn=2to18:pokes+n,s1(n):next:pokes+4,23:pokes+11,35
  49. 490 ifpeek(852)=252theny=80:c1=c1+1:li=10:n=c1:n$=str$(c1)+" 
  50. 500 [139][194](852)[178]254[167]y[178]200:c2[178]c2[170]1:li[178]16:n$[178][196](c2)[170]" 
  51. 510 cl=35:gosub600:printn$:poke2040,peek(852):pokev,35:pokev+16,1
  52. 520 pokev+1,y:pokev+29,1:pokev+23,1:pokev+21,255
  53. 530 poke53281,2:gosub570:forn=53000to53048:poken,peek(852):next
  54. 540 gosub570:pokev+29,255:gosub570:pokev+23,255:gosub570
  55. 550 pokev+29,peek(v+29)and1:gosub570:pokev+23,peek(v+23)and1:gosub570
  56. 560 gosub590:pokes+4,0:pokev+23,0:pokev+29,0:poke53281,14:goto150
  57. 570 forw=1to25:co=1-co:forn=0to7:pokead+n,co:next:next:return
  58. 580 forw=1to300:next:return
  59. 590 forw=1to1000:next:return
  60. 600 poke214,li:print:poke211,cl:return
  61. 610 poke855,0:sys16793:r=peek(855):r=r-int(r/7)*7
  62. 620 ifpeek(853)<>3thenra=int(rnd(0)*4)+c1*2:ifra=1thenr=int(rnd(0)*7)
  63. 630 ifdc=1and(c1-c2>2)and(r=r1)thenr=int(rnd(0)*7)
  64. 640 ifr=3anda(0,3)<>0thenr=int(rnd(0)*7):ifr=3then640
  65. 650 ifr=3then710
  66. 660 ifr>3thenaa=r-3:jv=8
  67. 670 ifr<3thenaa=3-r:jv=4
  68. 680 forn=1toaa:ifjv=8thenx=x+34:a=a+1:ifx>238thenx=34:a=0
  69. 690 ifjv=4thenx=x-34:a=a-1:ifx<34thenx=238:a=6
  70. 700 pokes+8,x+pl*14:pokes+11,17:poke53248,x:forwa=1to25:next:next
  71. 710 goto300
  72. 720 pokes+13,255:pokes+12,0:pokes+11,33:forwa=19000to2000step-2500
  73. 730 pokes+8,wa/300:forn=1to10:pokev+39,n
  74. 740 pokev+1,y-n:pokev,x-n:next:pokes+8,wa/156:next
  75. 750 pokes+11,0:pokev+39,0:return
  76. 760 print"[147]"tab(11)"[158] cats 'n' dogs "
  77. 770 print"[144]press  1 [146]  to play computer"
  78. 780 print"[144]press  2 [146]  to play a friend":c1=0:c2=0:dc=0:jy=0
  79. 790 gosub580:poke2040,254+c:poke2041,252+c:getk$:ifk$=""thenc=1-c:goto790
  80. 800 ifk$<>"1"andk$<>"2"then790
  81. 810 ifk$="1"thenprint"plug joystick into port 2":p2$="computer":goto870
  82. 820 print"[144]how many joysticks? (press 1 or 2)
  83. 830 [161]j$:[139]j$[178]""[167]830
  84. 840 [139]j$[179][177]"1"[175]j$[179][177]"2"[167]830
  85. 850 [139]j$[178]"1"[167][153]"plug joystick into port 2":[137]870
  86. 860 jy[178]1
  87. 870 [153]"print dog catcher on? (y/n) 
  88. 880 gosub580:poke2042,250+c:gety$:ify$=""thenc=1-c:goto880
  89. 890 ify$<>"y"andy$<>"n"then880
  90. 900 ify$="y"thendc=1
  91. 910 pokev+21,0:gosub590:print"[147]":ac=55327:as=1055
  92. 920 pokeac,2:pokeas,160:forn=1to8:pokeac+n,7:pokeas+n,160:next
  93. 930 ac=ac+40:as=as+40:ifas<2017then920
  94. 940 print""tab(32)"[144]cats 'n'[157][157][157][157][157][157]dogs":li=8:cl=32:gosub600
  95. 950 print""p1$:li=14:gosub600:print""p2$:return
  96. 960 data0,0,0,194,255,0,0,0,0,0,0,0,6,0,0,8,128
  97. 970 data0,0,0,0,0,0,0,0,8,0,0,252,3,0,0,8,128
  98. 980 li=5:gosub600:print"tie game":gosub720:ty=0:gosub600
  99. 990 print"[158]        ":goto150
  100.